{% extends 'actor/templates/settings_base.html' %}
{% load nonce %}
{% block settings %}

<h2>Profile Info</h2>

{% include 'form_error.html' %}
<form action="{{view.url}}/settings/profile" method="post">
  {{request.user|noncefield:"settings_update_account"}}
  <input type="hidden" name="settings_update_account" />
  <input type="hidden" name="nick" value="{{request.user.nick}}" />
  <div>
    Screen name
    <span><strong>{{view.display_nick}}</strong></span>
  </div>
  <div>
    <label for="first_name">First name</label>
    <input type="text" name="first_name" id="first_name" maxlength="60"
           class="text" value="{{view.extra.given_name}}"/>
  </div>
  <div>
    <label for="last_name">Last name</label>
    <input type="text" name="last_name" id="last_name" maxlength="60"
           class="text" value="{{view.extra.family_name}}"/>
  </div>

  {% if SMS_ENABLED %}
    <div>
      <label for="mobile">Mobile phone</label>
      {% if mobile %}
        <span><strong>{{mobile}}</strong>
          <a href="{{view.url}}/settings/mobile">(Change)</a>
        </span>
      {% else %}
        {% if unactivated_mobile %}
          <span>
            <strong>{{unactivated_mobile}}</strong>
            <a href="{{view.url}}/settings/mobile">(Not activated)</a>
          </span>
        {% else %}
          <span>
            <strong>None</strong>
            <a href="{{view.url}}/settings/mobile">(Add)</a>
          </span>
        {% endif %}
      {% endif %}
    </div>
  {% endif %}

  <div>
    <label for="email">Email address</label>
    {% if email %}
      <span>
        <strong>{{email}}</strong>
        <a href="{{view.url}}/settings/email">(Change)</a>
      </span>
    {% else %}
      {% if unconfirmed_email %}
        <span>
          <strong>{{unconfirmed_email}}</strong>
          <a href="{{view.url}}/settings/email">(Unconfirmed)</a>
        </span>
      {% else %}
        <span>
          <strong>None</strong>
          <a href="{{view.url}}/settings/email">(Add)</a>
        </span>
      {% endif %}
    {% endif %}
  </div>

  {% if IM_ENABLED %}
    <div>
      <label for="email">IM address</label>
      {% if im %}
        <span>
          <strong>{{im}}</strong>
          <a href="{{view.url}}/settings/im/">(Change)</a>
        </span>
      {% else %}
        <span>
          <strong>None</strong>
          <a href="{{view.url}}/settings/im">(Add)</a>
        </span>
      {% endif %}
    </div>
  {% endif %}
  <div class="buttons">
    <input type="submit" value="Save Changes"/>
  </div>
</form>

<a class="dangerous" href="{{view.url}}/settings/delete">
  Want to delete your account?
</a>

{% endblock %}
